More problems
[andmenj-acm.git] / Mi manual de algoritmos / version_maraton_interuniversitaria_2008-2 / src / combinatoria / pascal_triangle.cpp
blobda647c6a2c7e4bd6a34399416579d51bb971911b
1 const int N = 30;
2 long long choose[N+1][N+1];
3 /* Binomial coefficients */
4 for (int i=0; i<=N; ++i) choose[i][0] = choose[i][i] = 1;
5 for (int i=1; i<=N; ++i)
6 for (int j=1; j<i; ++j)
7 choose[i][j] = choose[i-1][j-1] + choose[i-1][j];